package com.shuai.jit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shuai.jit.entity.chat.Friend;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface FriendMapper extends BaseMapper<Friend> {


    /**
     * 获取朋友的用户信息
     * @param userId 用户id
     * @return
     */
    @Select("select * from friend where user_id=#{userId}")
    List<Friend> getFriend(String userId);


    @Select("select * from friend where user_id=#{userId} and friendId=#{friendId}")
    Friend getID(String userId,String friendId);

}